package com.rykj.qxj.server.model.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name="metadata_element")
@ApiModel("元数据字段")
public class MetadataElement {
    @Id
    @GeneratedValue
    private  int id;
    @ApiModelProperty(value = "表id")
    private  int tableId;
    @Pattern(regexp = "^[a-zA-Z_]+$",message = "只能是英文下划线")
    @ApiModelProperty(value = "字段名")
    private String fieldName;
    @ApiModelProperty(value = "字段类型")
    private String fieldType;
    @ApiModelProperty(value = "字段长度")
    private int fieldLength;
    @ApiModelProperty(value = "字段精度")
    private int fieldAccuracy;
    @ApiModelProperty(value = "是否为空")
    private String isEmpty;
    @ApiModelProperty(value = "是否主键")
    private String isKey;
    @ApiModelProperty(value = "默认值")
    private String defaultValue;
    @ApiModelProperty(value = "字段描述")
    private String fieldRemarks;
    @ApiModelProperty(value = "删除状态,normal:正常;delete删除")
    private String status;
    @ApiModelProperty(value = "是否自增")
    private String  isIncrease;
    @ApiModelProperty(value = "审核信息id")
    private Integer auditId;
    @ApiModelProperty(value = "创建人")
    private String  createdBy;
    @ApiModelProperty(value = "创建时间")
    private Date createdTime;

}
